bpo-33516: Add support for __round__ to MagicMock#6880
bpo-33516: Add support for __round__ to MagicMock#6880vstinner merged 1 commit intopython:masterfrom
Conversation
vstinner
left a comment
There was a problem hiding this comment.
Would it be possible to add a short unit test to Lib/unittest/test/testmock/testmagicmethods.py please?
It may be add nice to add tests for trunc and floor as well.
|
For Travis CI, your PR has be bitten by https://bugs.python.org/issue33531 :-( |
f9cd107 to
92c03e2
Compare
|
Added unit tests for round/trunc/floor/ceil, and fixed docs build. |
There was a problem hiding this comment.
The result of round(), trunc(), etc. are a number, not a boolean. You should use assertEqual(..., value) instead.
There was a problem hiding this comment.
Updated to assert equal to mock.__dunder__() calls.
vstinner
left a comment
There was a problem hiding this comment.
LGTM, except of the minor issue in the NEWS entry.
There was a problem hiding this comment.
Oh, you didn't mention the module. Please add "unittest.mock: " prefix to this NEWS entry.
|
Updated/reworded news entry to link to unittest.mock.MagicMock. |
|
Thanks @jreese, the change now LGTM. The final version is better than the first version ;-) |
Adds support for
__round__to MagicMock.https://bugs.python.org/issue33516